// pages/printerbox/printerstate/printerstate.js
import {
  getPrinterState
} from '../../../utils/networkRequest.js'
import {
  errorMsg
} from '../../../utils/tool.js'
Page({

  /**
   * 页面的初始数据
   */
  data: {
dataInfo:null
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    let self = this;

    getPrinterState("", (r) => {
      if (r.code == 0) {
         self.setData({
           dataInfo:r.data
         })
      } else {
        errorMsg(r.message);
      }
    })

  },
  onChangePrinter: function() {
    wx.navigateTo({
      url: '../printerlist/printerlist',
    })
  }
})